<%-- 
    Document   : CommentsList
    Created on : May 18, 2010, 8:57:20 PM
    Author     : vasi
--%>
<%@page import="java.lang.*"%>
<%@page import="java.util.*"%>
<%@page import="entities.*" %>
<%ContentEntity content = (ContentEntity)request.getAttribute("content"); %>
<%
                        List<CommentEntity> comments = (List)request.getAttribute("comments");
                        Iterator<CommentEntity> commentsIt = comments.iterator();
                        out.println("<div>");
                        while (commentsIt.hasNext()){
                            CommentEntity comment = commentsIt.next();
                            out.println("<div>");
                                out.println("<strong>"+comment.getSubject()+"</strong> by "+comment.getAuthor());
                                out.println("<div>"+comment.getComment()+"</div>");
                            out.println("</div>");
                        }
                        out.println("</div>");
                    %>
                    <form id="comment_post_form" action="<% out.print(request.getContextPath()); %>/content/view?cid=<%= content.getCid()%>" method="POST">
                        <table>
                            <tr>
                                <td>Subject:</td>
                                <td><input type="text" name="subject" size="60"/></td>
                            </tr>
                            <tr>
                                <td>Comment:</td>
                                <td><textarea name="comment" cols="69" rows="5"></textarea></td>
                            </tr>
                            <tr>
                                <td colspan="2"><input type="submit" value="Save" name="save" /></td>
                            </tr>
                            <input type="hidden" value="<%= content.getCid()%>" name="cid" />
                            <input type="hidden" value="submitted" name="submitted" />
                        </table>
                    </form>